package com.taysear.parcel.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="parcel_history")
public class ParcelHistory implements Serializable{

	private static final long serialVersionUID = -6627064324032762904L;
	@Id @Column(name="parcel_history_id") @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer parcelHistoryId;
	@OneToOne(fetch=FetchType.LAZY) @JoinColumn(name="parcel_id")
	private Parcel parcel;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="user_id")
	private User user;
	@Temporal(TemporalType.TIMESTAMP) 
	private Date date;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="parcel_action_id")
	private ParcelAction parcelAction;
	private String description;
	
	public Integer getParcelHistoryId() {
		return parcelHistoryId;
	}
	public void setParcelHistoryId(Integer parcelHistoryId) {
		this.parcelHistoryId = parcelHistoryId;
	}
	public Parcel getParcel() {
		return parcel;
	}
	public void setParcel(Parcel parcel) {
		this.parcel = parcel;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public ParcelAction getParcelAction() {
		return parcelAction;
	}
	public void setParcelAction(ParcelAction parcelAction) {
		this.parcelAction = parcelAction;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
}
